import OrdersOne from "../component/jly/OrdersOne";
import OrdersTwo from '../component/jly/OrdersTwo'
import InsertUser from "../component/jly/InsertUser";
import Zfbyes from "../component/jly/Zfbyes";
import Resultss from '../component/jly/Resultss'
import { Navigate, createBrowserRouter } from "react-router-dom";
import App from '../App'
import Launch from "../component/李璇/Launch";
import Login from "../component/李璇/Login";
import Phone from "../component/李璇/Phone";
import Email from "../component/李璇/Email";
import Face from "../component/李璇/Face";
import Register from '../component/李璇/Register'
let AuthComponent=(props)=>{
    let Com=props.children.type
    if(sessionStorage.getItem('token')){
        return<Com></Com>
    }else{
        return <Navigate to='/launch'></Navigate>
    }
}
const router = createBrowserRouter([
    {
        path:'/launch',
        element:<Launch></Launch>
    },

    {
        path:'/login',
        element:<Login></Login>
    },

    {
        path:'/phone',
        element:<Phone></Phone>
    },

    {
        path:'/face',
        element:<Face></Face>
    },

    {
        path:'/email',
        element:<Email></Email>
    },

    {
        path:'/register',
        element:<Register></Register>
    },

    {
        path:'/',
        element:<App></App>,
        children:[    //页面有底部footer的都是二级及以下路由，无底部可设置一级路由
        ]
    },{
        path:'/ordersone',
        element:<OrdersOne></OrdersOne>
    },{
        path:'/orderstwo',
        element:<OrdersTwo></OrdersTwo>
    },{
        path:'/insertuser',
        element:<InsertUser></InsertUser>
    },{
        path:'/zfbyes',
        element:<Zfbyes></Zfbyes>
    },{
        path:'/result',
        element:<Navigate to='/launch'></Navigate>
    }
])


export default router;